#include "TKSPStdAfx.h"
#include "DBXDevice.h"

namespace DBX
{
    class DBXDevice::Private
    {
    public:
        Private(DBXDevice *p)
            : o(p)
            , name("<UnknownDevice::Name>")
            , displayName("<UnknownDevice::DisplayName>")
            , type("<UnknownDevice::Type>")
            , timeout(30)
            , connected(false)
        {}

    private:
        friend class DBXDevice;
        DBXDevice *o;
        std::string name;
        std::string displayName;
        std::string type;
        int timeout;
        bool connected;
    };

    DBXDevice::DBXDevice()
        : p(*new Private(this))
    {}

    DBXDevice::~DBXDevice()
    {
        delete &p;
    }

    void DBXDevice::setName(const std::string &name)
    {
        p.name = name;
    }

    void DBXDevice::setDisplayName(const std::string &displayName)
    {
        p.displayName = displayName;
    }

    void DBXDevice::setType(const std::string &type)
    {
        p.type = type;
    }

    void DBXDevice::setTimeout(int timeout)
    {
        p.timeout = timeout;
    }

    std::string DBXDevice::name() const
    {
        return p.name;
    }

    std::string DBXDevice::displayName() const
    {
        return p.displayName;
    }

    int DBXDevice::timeout() const
    {
        return p.timeout;
    }

    bool DBXDevice::connected() const
    {
        return p.connected;
    }

    void DBXDevice::setConnected(bool connected)
    {
        p.connected = connected;
    }
} // namespace DBX